When specifying base classes for a class, the access level is private by default. While private inheritance has its uses, it is far less used than
public inheritance. Therefore:
- Either you want public inheritance, and you have to specify it
- Or you want private inheritance, and you should be explicit about this design decision, by specifying it too.
Noncompliant code example
class B {
};
class C : B {
};
Compliant solution
class B {
};
class C : private B { // Or public, if it was private by mistake
};